﻿using HalconDotNet;
using MachineVision.Core.TemplateMatch.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MachineVision.Core.TemplateMatch.LocalDeformable
{
    public class LocalDeformableRunParameter : BaseParameter
    {
        public override void ApplyDefaultParameter()
        {
            AngleStart = -0.39;
            AngleExtent = 0.79;
            ScaleRMin = 1;
            ScaleRMax = 1;
            ScaleCMin = 1;
            ScaleCMax = 1;

            MinScore = 0.5;
            NumMatches = 1;
            MaxOverlap = 1;
            NumLevels = 0;
            Greediness = 0.9;

            HOperatorSet.GenEmptyObj(out ImageRectified);
            HOperatorSet.GenEmptyObj(out VectorField);
            HOperatorSet.GenEmptyObj(out DeformedContours);
        }
        public HObject ImageRectified;
        public HObject VectorField;
        public HObject DeformedContours;
        private int numLevels;
        private double angleStart;
        private double angleExtent;
        private double minScore;
        private double greediness;
        private string subPixel;
        private double maxOverlap;
        private int numMatches;
        private double scaleRMin;
        private double scaleRMax;
        private double scaleCMin;
        private double scaleCMax;

        public int NumLevels { get => numLevels; set { numLevels = value; RaisePropertyChanged(); } }

        public double AngleStart { get => angleStart; set { angleStart = value; RaisePropertyChanged(); } }
        public double AngleExtent { get => angleExtent; set { angleExtent = value; RaisePropertyChanged(); } }
        public double MinScore { get => minScore; set { minScore = value; RaisePropertyChanged(); } }
        public double Greediness { get => greediness; set { greediness = value; RaisePropertyChanged(); } }
        public string SubPixel { get => subPixel; set { subPixel = value; RaisePropertyChanged(); } }
        public double MaxOverlap { get => maxOverlap; set { maxOverlap = value; RaisePropertyChanged(); } }
        public int NumMatches { get => numMatches; set { numMatches = value; RaisePropertyChanged(); } }
        public double ScaleRMin { get => scaleRMin; set { scaleRMin = value; RaisePropertyChanged(); } }
        public double ScaleRMax { get => scaleRMax; set { scaleRMax = value; RaisePropertyChanged(); } }
        public double ScaleCMin { get => scaleCMin; set { scaleCMin = value; RaisePropertyChanged(); } }
        public double ScaleCMax { get => scaleCMax; set { scaleCMax = value; RaisePropertyChanged(); } }
    }
}
